package com.buobao.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/test")
public class TestController {

    @GetMapping("/t1")
    public ModelAndView test1() {
        return new ModelAndView("/index");
    }

    @GetMapping("/t2")
    @ResponseBody
    public Map test2() {
        return new HashMap(){{
            put("name","test");
        }};
    }
}
